package com.jinxin.platform.cdsmsmgr.pojo.enums;

/**
 * @Author 那个男人
 * @Date 2023/1/6 15:47
 * @Version 1.0
 */
public enum SqlStatusEnum {
    INIT(0,"审核中"),
    PASS(1,"审核通过"),
    NOT_PASS(2,"审核未通过");

    private int code;
    private String desc;

    SqlStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    // 普通方法
    public static String getDesc(int code) {
        for (SqlStatusEnum c : SqlStatusEnum.values()) {
            if (c.getCode() == code) {
                return c.desc;
            }
        }
        return null;
    }

    public static Integer getCode(String desc){
        for (SqlStatusEnum c : SqlStatusEnum.values()) {
            if (c.getDesc().equals(desc)) {
                return c.code;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
